Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: self in pure functions #3027

Merged
merged 6 commits into from
Aug 5, 2022
Merged

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Aug 4, 2022

What I did

Fix for #3021

How I did it

Check for standalone accesses to self by filtering out Name nodes with an ancestor that is not an Attribute node.

How to verify it

See test

Commit message

fix: access to `self` in pure functions

Description for the changelog

Disable access to self in pure functions

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2022

Codecov Report

Merging #3027 (fb12cdc) into master (38eb512) will decrease coverage by 21.13%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master    #3027       +/-   ##
===========================================
- Coverage   88.30%   67.16%   -21.14%     
===========================================
  Files          97       97               
  Lines       10948    10947        -1     
  Branches     2587     2523       -64     
===========================================
- Hits         9668     7353     -2315     
- Misses        831     2944     +2113     
- Partials      449      650      +201     
Impacted Files Coverage Δ
vyper/semantics/validation/local.py 61.56% <100.00%> (-29.66%) ⬇️
vyper/builtin_functions/utils.py 0.00% <0.00%> (-100.00%) ⬇️
vyper/ir/s_expressions.py 5.88% <0.00%> (-88.24%) ⬇️
vyper/ast/natspec.py 12.34% <0.00%> (-86.42%) ⬇️
vyper/cli/utils.py 16.66% <0.00%> (-71.43%) ⬇️
vyper/compiler/utils.py 30.00% <0.00%> (-70.00%) ⬇️
vyper/cli/vyper_json.py 9.44% <0.00%> (-69.59%) ⬇️
vyper/compiler/output.py 27.74% <0.00%> (-61.26%) ⬇️
vyper/semantics/validation/data_positions.py 36.55% <0.00%> (-54.84%) ⬇️
vyper/builtin_functions/convert.py 38.35% <0.00%> (-52.69%) ⬇️
... and 53 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@tserg tserg marked this pull request as ready for review August 5, 2022 04:01
@charles-cooper charles-cooper enabled auto-merge (squash) August 5, 2022 13:24
@charles-cooper charles-cooper merged commit 8041ebd into vyperlang:master Aug 5, 2022
@tserg tserg deleted the fix/pure branch August 5, 2022 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants